<template>
	<view>
		<u--form errorType="toast" :model="setForm" ref="myForm" :rules="rules" labelWidth="280">
			<view class="padding-30 line-gray fsize-26">状态设置</view>
			<u-form-item label="功能状态" prop="functionalStatus" borderBottom>
				<u-switch slot="right" v-model="setForm.functionalStatus" activeColor="#e54d42" />
			</u-form-item>
			<u-form-item label="开启渐推客户分红" prop="recStatus" borderBottom>
				<u-switch slot="right" v-model="setForm.recStatus" activeColor="#e54d42" />
			</u-form-item>
			<u-form-item label="扣除二级分销" prop="subordinate">
				<u-switch slot="right" v-model="setForm.subordinate" activeColor="#e54d42" />
			</u-form-item>
			<view class="padding-30 line-gray fsize-26">比例设置</view>
			<u-form-item label="限制股本消费最低值" prop="astrict" borderBottom>
				<u-input v-model="setForm.astrict" border="none" type="number" inputAlign="right"/>
				<text slot="right">%</text>
			</u-form-item>
			<u-form-item label="联创直推联创之收益分红" prop="award" borderBottom>
				<u-input v-model="setForm.award" border="none" type="number" inputAlign="right"/>
				<text slot="right">%</text>
			</u-form-item>
			<u-form-item label="联创推荐联创之现金奖励" prop="award2" borderBottom>
				<u-input v-model="setForm.award2" border="none" type="number" inputAlign="right"/>
				<text slot="right">%</text>
			</u-form-item>
			<u-form-item label="联创有员工协助推荐联创之现金奖励" prop="award3">
				<u-input v-model="setForm.award3" border="none" type="number" inputAlign="right"/>
				<text slot="right">%</text>
			</u-form-item>
		</u--form>
		<view class="pl-30 pr-30 pt-60">
			<u-button color="#e54d42" text="保存设置" @click="submit" size="large" />
		</view>
		<u-toast ref="uToast" />
	</view>
</template>

<script>
	export default {
		data() {
			return {
				setForm: {
					functionalStatus: true,
					recStatus: true,
					subordinate: false,
					astrict: 0,
					award3: 0,
					award2: 0,
					award: 0,
				},
				rules: {
					nickName: [{
						required: true,
						message: '请输入昵称',
						trigger: ['blur', 'change']
					}]
				}
			}
		},
		onLoad() {
			
		},
		onReady() {
			this.$refs.myForm.setRules(this.rules)
		},
		methods: {
			submit() {
				let that = this;
				that.$refs.myForm.validate().then(res => {
					console.log(res)
				})
			}
		},
	}
</script>
